import BaseModel from "../baseModel.js";

class MessageModel extends BaseModel {
    /**
     * @param {MessageModel} model 
     * @returns {}
     */
    constructor(model) {
        super(model);
        /* 自定义属性以及重载 */
        this.sendID = MessageModel.CheackNull(model.sendID, 'sendID');
        this.receiverID = model.receiverID;
        this.messageType = MessageModel.CheackBoolean(model.messageContent);  // 0:普通信息 1:系统信息
        this.messageContent = model.messageContent;
        this.sendTime = model.sendTime || new Date();
        this.status = MessageModel.CheackBoolean(model.status);  // 1：已读
    }
    static Instance = 'message'
}
export default MessageModel;